﻿@model IEnumerable<MobileSales.Model.Products.Category>

@{
    View.Title = Strings.Categories;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<link href="@Url.Content("~/Content/Treeview.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.treeview.js")"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#categoryTree").treeview();
    });
</script>

<h2>@Strings.Categories</h2>

<p>
    @Html.ActionLink(Strings.CreateNew, "Create", null, new { @class = "icon-button add-icon" })
</p>

@if (Model != null)
{
    <ul id="categoryTree">
    @foreach (var item in Model)
    {
        @Html.CategoryTree(item, "Categories")
    }
    </ul>
}

